package cn.edw.swu.bc.swucommunity

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class DBUserHelper(
    context: Context?,
    name: String?,
    version: Int
) : SQLiteOpenHelper(context, name, null, version) {


    override fun onCreate(db: SQLiteDatabase) {
        db.execSQL(
            "CREATE TABLE ${User.TABLE} (\n" +
                    "\t${User.UID} integer PRIMARY KEY autoincrement,\n" +
                    "\t${User.USERNAME} text unique,\n" +
                    "\t${User.PASSWORD} text)"
        )
    }

    override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
        TODO("Not yet implemented")
    }
}